import java.util.PriorityQueue;
import java.util.Scanner;

public class Answer3 {
    // 除2
    //https://ac.nowcoder.com/acm/problem/213140
    public static void main(String[] args) {
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int k=in.nextInt();

        PriorityQueue<Integer> priority=new PriorityQueue<>((a,b)-> {
            return b - a;
        });
        long sum=0;
        for(int i=0;i<n;i++){
            int t=in.nextInt();
            sum+=t;
            if(t%2==0){
                priority.add(t);
            }
        }
        while(!priority.isEmpty() && k-- !=0){
            int a= priority.poll()/2;
            sum-=a;
            if(a %2==0){
                priority.add(a);
            }
        }
        System.out.println(sum);
    }
}
